cmake_minimum_required(VERSION 3.3)
project(myhttpserver C CXX)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")

message(STATUS "This is binary dir " ${PROJECT_BINARY_DIR})
message(STATUS "This is source dir " ${PROJECT_SOURCE_DIR})

FIND_PACKAGE ( Threads REQUIRED )

set(SOURCE_FILES main.c core/sources/http_deal.c core/sources/request.c
core/sources/socket_thread_map.c core/sources/my_functon.c core/sources/response.c)

set(TEST_FILES core/sources/http_deal.c test.c core/sources/request.c
        core/sources/socket_thread_map.c core/sources/my_functon.c core/sources/response.c)

#add_definitions(-std=c99)
include_directories(core/headers)
include_directories(uthash)
add_subdirectory(core/sources core/headers)

add_executable(myhttpserver ${SOURCE_FILES})
add_executable(myhttpserver-test ${TEST_FILES})
TARGET_LINK_LIBRARIES ( myhttpserver ${CMAKE_THREAD_LIBS_INIT} )